package com.server.pinggu.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.server.pinggu.mapper.SenCountHitMapper;
import com.server.pinggu.domain.SenCountHit;
import com.server.pinggu.service.ISenCountHitService;

import java.util.List;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author ltao
 * @date 2022-10-23
 */
@Service
public class SenCountHitServiceImpl extends ServiceImpl<SenCountHitMapper, SenCountHit> implements ISenCountHitService {

    @Override
    public List<SenCountHit> queryList(SenCountHit senCountHit) {
        LambdaQueryWrapper<SenCountHit> lqw = Wrappers.lambdaQuery();
        if (senCountHit.getDate() != null){
            lqw.eq(SenCountHit::getDate ,senCountHit.getDate());
        }
        if (StringUtils.isNotBlank(senCountHit.getCount())){
            lqw.eq(SenCountHit::getCount ,senCountHit.getCount());
        }
        if (senCountHit.getTotal() != null){
            lqw.eq(SenCountHit::getTotal ,senCountHit.getTotal());
        }
        if (senCountHit.getAllTotal() != null){
            lqw.eq(SenCountHit::getAllTotal ,senCountHit.getAllTotal());
        }
        return this.list(lqw);
    }
}